<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>联调激活</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__ICON__">

    <style>
        .desc,p{
            padding-top:10px !important;
        }
        .icon-copy{
            color: #1E9FFF !important;
            cursor: pointer;
        }
    </style>
</head>
<body>

<div class="layui-form" style="padding: 20px 30px 0 0;">

        <div class="layui-form-item">
            <label class="layui-form-label">监测链接</label>
            <div class="layui-inline" style="width: 80%;">
                <input type="text" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="{$monitor}"  id="monitor">
            </div>
            <div class="layui-inline">
            <button type="button" class="layui-btn" onclick="copy()">复制链接</button>
            </div>

            <div class="layui-form-mid layui-word-aux" style="margin-left: 110px;">
                <div class="desc">
                    <div class="h3">提示：</div>
                    <p>1.到百度营销后台 工具中心->转换追踪 新建应用调起的线索API转换追踪</p>
                    <p>2.复制监测地址，填写上方生成的监测地址保存</p>
                    <input type="hidden" value="{$suffix}"  id="suffix">
                    <p>3.点击联调，填写调起url中输入提取的hapApp链接<i class="layui-icon layui-icon-about" id="tooltip_hap"></i>，并在hap链接后拼接{$suffix}<span class="iconfont icon-copy"  onclick="copy2()" lay-tips="复制"> </span>进入下一步</p>
                    <p>4.使用<a href="https://mobile2.baidu.com/index.html" target="_blank" style="color: #009688;"> 百度营销APP </a>扫码访问，点击测试广告进入App</p>
                </div>
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">激活链接</label>
            <div class="layui-input-block">
                <input type="text" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="{$jhLink}">
            </div>
            <div class="layui-form-mid layui-word-aux" style="margin-left: 110px;">
                <div class="desc">
                    <p>5.点击下方激活按钮</p>
                    <p>6.访问激活链接查看到“账户激活配置成功”即代表激活成功，亦可点击下一步查看激活状态</p>
                    <p>7.激活成功后，百度的测试联调点击下一步进入回传反馈，查看的是否联调成功</p>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" type="button" onclick="jump('{$jhLink}');">激活</button>
            </div>
        </div>
</div>

<script src="/static/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
        xmSelect: 'xmSelect/xm-select'
    }).use(['index', 'form','xmSelect'], function(){
        var $ = layui.$
            ,form = layui.form

        //联调提示
        $("#tooltip_hap").hover(function () {
            layer.tips('<img src="/static/imgs/tip_hap.png" width="600">', this, {
                tips: [4, "#333"],
                time: 80000,
                // area: ['80%', '80%'],
            });
        },function () {
            layer.closeAll('tips');
        });

    });

    function copy() {
        var link = layui.$("#monitor").select().val(); // 选择对象
        const textArea = document.createElement('textArea')
        textArea.value = link;
        textArea.style.width = 0
        textArea.style.position = 'fixed'
        textArea.style.left = '-999px'
        textArea.style.top = '10px'
        textArea.setAttribute('readonly', 'readonly')
        document.body.appendChild(textArea)
        textArea.select()
        document.execCommand('copy')
        layer.msg('复制成功', {icon: 1, time: 1000});
        document.body.removeChild(textArea)
    }


    function copy2() {
        var link = layui.$("#suffix").select().val(); // 选择对象
        const textArea = document.createElement('textArea')
        textArea.value = link;
        textArea.style.width = 0
        textArea.style.position = 'fixed'
        textArea.style.left = '-999px'
        textArea.style.top = '10px'
        textArea.setAttribute('readonly', 'readonly')
        document.body.appendChild(textArea)
        textArea.select()
        document.execCommand('copy')
        layer.msg('复制成功', {icon: 1, time: 1000});
        document.body.removeChild(textArea)
    }


    function jump(link) {
        window.open(link, '_blank');
    }

</script>
</body>
</html>